package com.my.controller.dataClean;

import com.my.service.dataClean.IDataUserService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by wt on 2017/10/13.
 */
@RestController
public class DataUserController {
    private Logger logger = LoggerFactory.getLogger(DataUserController.class);

    @Autowired
    private IDataUserService dataUserService;

    /**
     * 用户信息清洗
     */
    @PostMapping(value = "data/user")
    public void browserRelated(){
        Date endTime = new Date();
        Date startTime = null;

        logger.info("开始清洗数据: 用户信息相关,[{}]-[{}]", startTime, endTime);
        Map<String, Object> readParams = new HashMap<String, Object>();
        readParams.put("startTime", startTime);
        readParams.put("endTime", endTime);
        this.dataUserService.insertUserBaseMsg(readParams);

        logger.info("结束清洗数据: 用户信息相关,[{}]-[{}]", startTime, endTime);

    }
}
